package ui.actionhandler;


import javax.swing.*;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;

/**
 * Created with IntelliJ IDEA.
 * User: Deshun
 * Date: 2/18/13
 * Time: 10:24 AM
 * To change this template use File | Settings | File Templates.
 */
public class RowMouseAdaptor extends MouseAdapter {

    @Override
    public void mousePressed(MouseEvent e) {
        if ( e.getSource() instanceof JPanel ) {
            ((JPanel) e.getSource()).requestFocus();
        }
    }

    @Override
    public void mouseExited(MouseEvent e) {
        //TODO lose focus
        if ( e.getSource() instanceof JPanel ) {

        }
    }

    @Override
    public void mouseEntered(MouseEvent e) {
        if( e.getSource() instanceof JPanel ) {
            ((JPanel) e.getSource()).requestFocus();
        }
    }
}
